#include "menu.h"
#include "ui_menu.h"

Menu::Menu(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Menu)
{
    ui->setupUi(this);
    setFixedSize(GAME_WIDTH,GAME_HEIGHT);
    ui->start->setStyleSheet("color:white;background:transparent;border:none");
    ui->out->setStyleSheet("color:white;background:transparent;border:none");

    connect(ui->start,&QPushButton::clicked,this,[=]{
        this->hide();
        m=new Widget;
        m->show();
    });
    connect(ui->out,&QPushButton::clicked,this,[=]{
        this->close();
    });

}
void Menu::paintEvent(QPaintEvent*)
{
    QPainter painter(this);
    painter.drawPixmap(0,0,this->width(),this->height(),QPixmap(MAP_PATH));
}
Menu::~Menu()
{
    delete ui;
}
